<#include "/common/taglibs.ftl" />
<@menu code='${entityName!}'/>
<title><@spring.message code="${entityName!}" /> - <@spring.message code="list" /></title>
<div class="m-portlet m-portlet--mobile m-portlet--tabs">
    <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
            <div class="m-portlet__head-title">
                <h3 class="m-portlet__head-text">
                    <i class="la la-user"></i> <@spring.message code="${entityName!}"/>
                </h3>
            </div>
        </div>
        <div class="m-portlet__head-tools">
            <ul class="nav nav-tabs m-tabs-line m-tabs-line--success m-tabs-line--2x" role="tablist">
                <li class="nav-item m-tabs__item">
                    <a class="nav-link m-tabs__link ${(!RequestParameters['search_EQ_read']??)?string('active','')}" href="${ctx}/${baseUrl!}" role="tab">
                        <i class="la la-table"></i> <@spring.message code="all"/><@spring.message code="${entityName!}"/>
                    </a>
                </li>
                <li class="nav-item m-tabs__item">
                    <a class="nav-link m-tabs__link ${(RequestParameters['search_EQ_read']! == 'false')?string('active','')}" href="${ctx}/${baseUrl!}?search_EQ_read=false" role="tab">
                        <i class="la la-table"></i> <@spring.message code="notification.unread.prefix"/><@spring.message code="${entityName!}"/>
                    </a>
                </li>
                <li class="nav-item m-tabs__item">
                    <a class="nav-link m-tabs__link ${(RequestParameters['search_EQ_read']! == 'true')?string('active','')}" href="${ctx}/${baseUrl!}?search_EQ_read=true" role="tab">
                        <i class="la la-table"></i><@spring.message code="notification.read.prefix"/><@spring.message code="${entityName!}"/>
                    </a>
                </li>
            </ul>
        </div>
    </div>
    <div class="m-portlet__body">
        <div class="table-container">
            <@showMessage />
            <@tableHeaderButtons resourceIdentity='${resourceIdentity!}'/>
            <@tableColumnButtons resourceIdentity='${resourceIdentity!}'/>
            <table class="table table-striped- table-bordered table-hover table-checkable dataTable dtr-inline" id="datatable"
                   data-datatable="true"
                   data-datatable-advance-search="show"
                   data-datatable-quick-search-filter="search_LIKE_key_OR_message_OR_locale"
            >
                <thead>
                <tr role="row" class="heading">
                    <th width="1%" data-checkable="true" data-orderable="false"></th>
                    <th width="5%" data-data="id" data-searchable="false"> ID# </th>
                    <th width="8%" data-data="userId" data-render="renderUser"> <@spring.message code="user"/> </th>
                    <th width="8%" data-data="module" data-render="renderModule" data-search-type="<@searchTypeSelect items=modules/>"> <@spring.message code="notification.module"/> </th>
                    <th width="10%" data-data="title"> <@spring.message code="notification.title"/> </th>
                    <th data-data="content"> <@spring.message code="notification.content"/> </th>
                    <#if !RequestParameters['search_EQ_read']??>
                        <th width="8%" data-data="read" data-render="renderBoolean" data-search-type="<@searchTypeSelectBoolean/>"> <@spring.message code="notification.read"/> </th>
                    </#if>
                    <th width="15%" class="center" data-data="lastModifiedDate" data-search-type="daterange" data-render="renderDateTime"> <@spring.message code="lastModifyDate"/> </th>
                    <th width="15%" data-actions="true"> <@spring.message code="action"/> </th>
                </tr>
                </thead>
                <tbody> </tbody>
            </table>
        </div>
    </div>
</div>

<page-plugin-style>
</page-plugin-style>
<page-style>
</page-style>
<page-plugin-script>
</page-plugin-script>
<page-script>
    <#include "/system/script.ftl" />
    <script>
        function renderModule( data, type, full, meta ){
            <#list modules as t>
                if(data=='${t}'){
                    return '<@spring.message code="notification.module.${t}"/>';
                }
            </#list>
            return '';
        }
    </script>
</page-script>